﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/mobileCss", "~/Content/css")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <div data-role="page">
        <div data-role="header" data-position="fixed">
            @if (IsSectionDefined("Header"))
            {
                @RenderSection("Header", required: false)
            }
            else
            {
                @Html.ActionLink("Home", "Index", "Home", null, new Dictionary<string, object> { { "data-icon", "home" }, { "class", "ui-btn-left" } })
                <h1>@ViewBag.Title</h1>
                
            }
            @Html.ActionLink("Login", "Index", "Home", null, new Dictionary<string, object> { { "data-icon", "home" }, { "class", "ui-btn-right" } })
        </div>
        <div data-role="content">
            <div class="content-secondary">
                @if (IsSectionDefined("Content1st"))
                { 
                    @RenderSection("Content1st", required: false)
                }
                else
                { 
                    <ul data-role="listview" data-filter="true" data-filter-placeholder="Search tables...">
                        @foreach (TableGroupModel item in ViewBag.TableGroupModels)
                        { 
                            <li data-role="list-divider">@item.Name</li>
                            if (item != null)
                            {
                                foreach (TableModel subitem in item.Tables)
                                { 
                            <li>@Html.ActionLink(@subitem.Name, "Details", "Tables", new { id = @subitem.ID }, null)</li>
                                }
                            }
                        }
                    </ul>
                }
            </div>
            <div class="content-primary">
                @RenderBody()
            </div>
        </div>
        <div data-role="footer" data-position="fixed">
            @if (IsSectionDefined("Footer"))
            {
                @RenderSection("Footer", required: false)
            }
            else
            {

            }
        </div>
    </div>
   
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jquerymobile")
    @RenderSection("scripts", required: false)
</body>
</html>
